$themes: (
        light: (
          //字体
                font_color1: #303133,
                font_color2: #606266,
          //背景
                background_color1: #f3f6f9,
                background_color2: #f6f7f9,
                background_color3: #ffffff,
                background_color4: #ffffff,
                background_color5: #f6f8fa,
                background_color6: #f6f8fa,
          //边框
                border_color1: #DCDFE6,
                border_color2: #8bb9f3,
                border_color3: #fafafb,
          //背景图
                background_img1: url("/src/assets/images/wave-light.png")
        ),
        dark: (
          //字体
                font_color1: #d6d6d6,
                font_color2: #a3a3a3,
          //背景
                background_color1: #000000,
                background_color2: #141414,
                background_color3: #1F1F1F,
                background_color4: #000000,
                background_color5: #bfbfbf,
                background_color6: #262626,
          //边框
                border_color1: #3d414a,
                border_color2: #3d414a,
                border_color3: #595959,
          //背景图
                background_img1: url("/src/assets/images/wave-dark.png")
        )
);

//遍历主题map
@mixin themeify {
  @each $theme-name, $theme-map in $themes {
    //!global 把局部变量提升为全局变量
    $theme-map: $theme-map !global;
    //判断html的data-theme的属性值  #{}是sass的插值表达式
    //& sass嵌套里的父容器标识   @content是混合器插槽，像vue的slot
    [data-theme="#{$theme-name}"] & {
      @content;
    }
  }
}

//声明一个根据Key获取颜色的function
@function themed($key) {
  @return map-get($theme-map, $key);
}

//获取背景颜色
@mixin background_color($color) {
  @include themeify {
    background-color: themed($color) !important;
  }
}

//获取字体颜色
@mixin font_color($color) {
  @include themeify {
    color: themed($color) !important;
  }
}

//获取边框颜色
@mixin border_color($color) {
  @include themeify {
    border-color: themed($color) !important;
  }
}

//边框阴影
@mixin border_shadow($color) {
  @include themeify {
    box-shadow: 0 0.133rem 0.133rem themed($color) !important;
  }
}

//背景图片
@mixin background_img($url) {
  @include themeify {
    background-image: themed($url) !important;
  }
}

//时间轴边框伪元素
@mixin label_after($color) {
  @include themeify {
    border-right-color: themed($color) !important;
  }
}
//评论组件下边框
@mixin border_bottom($color) {
  @include themeify {
    border-bottom: 1px solid themed($color) !important;
  }
}
